You are here: Survey management > Integrating a survey with your application > Calling a simple question from a flow

Calling a simple question from a flow

You can call a simple question from a flow to ask a user for information while they process a case. By using the Question smart shape, you can quickly add survey functionality to your application without creating the overhead of a survey with question pages. The use of individual questions in a flow is also supported in offline mode.

Complex questions are not supported by the Question shape.

  1. Open a flow in your application. If you are working offline, open a flow.

  2. Click the Shape palette icon to view a menu of shapes.

  3. Click and drag the Question shape from the Smart Shapes submenu to a position on the flow diagram.

  4. Double-click the Question shape and configure it by doing the following:

    1. In the Subprocess field, enter a name that describes the purpose of the subprocess.

    2. In the Select question field, press the Down Arrow key and select the name of a simple question.

    3. Optional: Select the Required check box.

    4. Optional: Expand the Advanced section to define the processing that occurs before the question is displayed and after the user submits an answer.

      A best practice is to always use both pre- and post-JavaScript and an activity. JavaScript provides offline validation, and the activity provides online validation. JavaScript functions use names without quotes. The JavaScript files should be bundled, attached to the harness, and available during execution.

    5. Click Submit.

  5. Connect the Question shape to other shapes in the flow.

    The flow results on the outgoing connectors from a Question smart shape contain the selected answer value for that question when executed. If the flow path needs to change based on the answer to a question, it can be achieved using the connectors from the Question smart shape.

  6. Click Save.

At run time, the question is formatted based on the settings on the Simple Question form.

Note: This functionality is available when you purchase and install the PegaSurvey application.